//
//  SingViewCell.m
//  Kugou-OC
//
//  Created by BH on 16/5/9.
//  Copyright © 2016年 Sunny. All rights reserved.
//

#import "SingViewCell.h"
#import "GlobalDefine.h"
#import <SDAutoLayout/UIView+SDAutoLayout.h>

@implementation SingViewCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifier = @"SingViewCell";
    SingViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[SingViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    
    return cell;
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        
        _imageV = [[UIImageView alloc] init];
        _titleLab = [[UILabel alloc] init];
        
        [self.contentView sd_addSubviews:@[_imageV,_titleLab]];
    }
    
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    _titleLab.font = TITLE_THIRD_FONT;
    
    _imageV.sd_layout.leftSpaceToView(self.contentView,15).topSpaceToView(self.contentView,5).bottomSpaceToView(self.contentView,5).widthEqualToHeight();
    _titleLab.sd_layout.leftSpaceToView(_imageV,15).centerYEqualToView(_imageV).widthIs(SCREEN_WIDTH-20-_imageV.width-35).autoHeightRatio(0);
}

@end
